package cn.secby.distributor.service.impl;
import cn.secby.common.core.web.mapper.WrapperParse;
import java.util.List;
import cn.secby.common.core.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import cn.secby.distributor.mapper.DistributorMapper;
import cn.secby.distributor.domain.Distributor;
import cn.secby.distributor.service.IDistributorService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import java.util.Arrays;

/**
 * 渠道商Service业务层处理
 * @author shenkunlin
 * @date 2025-04-26
 */
@Service
public class DistributorServiceImpl extends ServiceImpl<DistributorMapper, Distributor> implements IDistributorService
{
    @Autowired
    private DistributorMapper distributorMapper;

    /**
     * 查询渠道商
     * @param id 渠道商主键
     * @return 渠道商
     */
    @Override
    public Distributor selectDistributorById(Long id)
    {
        return getById(id);
    }

    /**
     * 查询渠道商列表
     * @param distributor 渠道商
     * @return 渠道商
     */
    @Override
    public List<Distributor> selectDistributorList(Distributor distributor)
    {
        return list(WrapperParse.query(distributor));
    }

    /**
     * 新增渠道商
     * @param distributor 渠道商
     * @return 结果
     */
    @Override
    public Boolean insertDistributor(Distributor distributor)
    {
        return save(distributor);
    }

    /**
     * 修改渠道商
     * @param distributor 渠道商
     * @return 结果
     */
    @Override
    public Boolean updateDistributor(Distributor distributor)
    {
        return updateById(distributor);
    }

    /**
     * 批量删除渠道商
     * @param ids 需要删除的渠道商主键
     * @return 结果
     */
    @Override
    public Boolean deleteDistributorByIds(List<Long> ids)
    {
        return removeByIds(ids);
    }

    /**
     * 删除渠道商信息
     * @param id 渠道商主键
     * @return 结果
     */
    @Override
    public Boolean deleteDistributorById(Long id)
    {
        return removeById(id);
    }
}
